package com.wiscamp.ninechapters.problems.domain.models.sheets;

import com.wiscamp.ninechapters.problems.domain.models.problems.questions.CalculationQuestion;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 答题卡明细-计算题
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CalculationSheetDetail extends SheetDetail {
    /**
     * 计算问题
     */
    private CalculationQuestion question;

    /*@Override
    public void scoreAnswers() {
        var correctAnswer = question.getCurrentAnswer();
        var sheetAnswers = this.getSheetAnswers();
        if (sheetAnswers.size() != 1) {
            ExceptionUtils.throwServiceException(ProblemsErrorCodes.SHEET_DETAIL_ANSWER_NOT_MATCH, null);
        }
        var sheetAnswer = sheetAnswers.stream().findFirst().orElse(null);
        sheetAnswer.correctAnswer(correctAnswer);
        var gainScore = calculateGainScore(question.getScoringRule(), sheetAnswer.isSkipped(), sheetAnswer.isCorrect(), question.getQuestionScore());
        reviewAndScore(gainScore);
    }*/
}
